/**
 * Created by lmn on 2016-04-18.
 * Initialize the "log4js" object, and make a direction for the files.
 */
var log4js = require('log4js');
var fs = require('fs');
var path=require('path');
var filePath = path.resolve('logs');
if(!fs.existsSync(filePath)){
    fs.mkdirSync(filePath);
}
log4js.configure({
    appenders: [
        {
            type:'dateFile',
            filename:'logs/log4js',
            backups: 1,
            alwaysIncludePattern: true,
            pattern: "-yyyy-MM-dd.log"
        }
    ]
});
module.exports = log4js;